package com.shenglue.ssi.service;

import java.util.List;

import com.shenglue.ssi.dao.DealerDao;
import com.shenglue.ssi.domain.BuyInMain;
import com.shenglue.ssi.domain.Dealer;

public class DealerServiceImpl implements DealerService {

	private DealerDao dealerDao;
	
	public DealerDao getDealerDao() {
		return dealerDao;
	}

	public void setDealerDao(DealerDao dealerDao) {
		this.dealerDao = dealerDao;
	}

	/**
	 * 查询所有经销商信息
	 */
	public List<Dealer> selectAllDealer() {
		return dealerDao.selectAllDealer();
	}

	/**
	 * 增加经销商记录
	 */
	public boolean saveDealer(Dealer dealer){
		return dealerDao.saveDealer(dealer);
	}

	/**
	 * 删除经销商记录
	 */
	public boolean deleteDealer(int buyInId) {
		return dealerDao.deleteDealer( buyInId );
	}

	/**
	 * 修改经销商记录
	 */
	public boolean updateDealer(Dealer dealer){
		return dealerDao.updateDealer(dealer);
	}
	/**
	 * 为修改，根据 Id 查一条 入库单主表记录
	 */
	public Dealer getOneDealerForUpdate( int dealerId ){
		
		return dealerDao.getOneDealerForUpdate( dealerId );
	}
}
